.class public final Lcom/baidu/crabsdk/b/m;
.super Ljava/lang/Object;


# static fields
.field private static bi:Landroid/content/SharedPreferences; = null

.field private static bj:Landroid/content/SharedPreferences$Editor; = null

.field private static bk:J = 0x7530L


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method public static B()V
    .locals 3

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    invoke-static {}, Lcom/baidu/crabsdk/b/m;->C()I

    move-result v1

    add-int/lit8 v1, v1, 0x1

    const-string v2, "used_count"

    invoke-interface {v0, v2, v1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/baidu/crabsdk/c/c;->a(Landroid/content/SharedPreferences$Editor;Z)V

    return-void
.end method

.method public static C()I
    .locals 3

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bi:Landroid/content/SharedPreferences;

    const-string v1, "used_count"

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    return v0
.end method

.method public static clear()V
    .locals 3

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    if-eqz v0, :cond_0

    const/4 v1, 0x0

    const-string v2, "used_count"

    invoke-interface {v0, v2, v1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    invoke-static {v0, v1}, Lcom/baidu/crabsdk/c/c;->a(Landroid/content/SharedPreferences$Editor;Z)V

    :cond_0
    return-void
.end method

.method public static d(Landroid/content/Context;)V
    .locals 2

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bi:Landroid/content/SharedPreferences;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    const-string v1, "crab_app_life"

    invoke-virtual {p0, v1, v0}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object p0

    sput-object p0, Lcom/baidu/crabsdk/b/m;->bi:Landroid/content/SharedPreferences;

    :cond_0
    sget-object p0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    if-nez p0, :cond_1

    sget-object p0, Lcom/baidu/crabsdk/b/m;->bi:Landroid/content/SharedPreferences;

    invoke-interface {p0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object p0

    sput-object p0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    :cond_1
    return-void
.end method

.method public static onPause(Landroid/content/Context;)V
    .locals 3

    invoke-static {p0}, Lcom/baidu/crabsdk/b/m;->d(Landroid/content/Context;)V

    sget-object p0, Lcom/baidu/crabsdk/b/m;->bi:Landroid/content/SharedPreferences;

    if-eqz p0, :cond_0

    sget-object p0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    if-eqz p0, :cond_0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    sget-object p0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    const-string v2, "used_last_time"

    invoke-interface {p0, v2, v0, v1}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    sget-object p0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    const/4 v0, 0x0

    invoke-static {p0, v0}, Lcom/baidu/crabsdk/c/c;->a(Landroid/content/SharedPreferences$Editor;Z)V

    :cond_0
    return-void
.end method

.method public static onResume(Landroid/content/Context;)V
    .locals 6

    invoke-static {p0}, Lcom/baidu/crabsdk/b/m;->d(Landroid/content/Context;)V

    sget-boolean v0, Lcom/baidu/crabsdk/a;->M:Z

    if-nez v0, :cond_2

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bi:Landroid/content/SharedPreferences;

    if-eqz v0, :cond_1

    sget-object v0, Lcom/baidu/crabsdk/b/m;->bj:Landroid/content/SharedPreferences$Editor;

    if-eqz v0, :cond_1

    const-string v0, "MobclickAgent init success!"

    invoke-static {v0}, Lcom/baidu/crabsdk/c/a;->s(Ljava/lang/String;)I

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    sget-object v2, Lcom/baidu/crabsdk/b/m;->bi:Landroid/content/SharedPreferences;

    const-wide/16 v3, 0x0

    const-string v5, "used_last_time"

    invoke-interface {v2, v5, v3, v4}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v2

    sub-long/2addr v0, v2

    sget-wide v2, Lcom/baidu/crabsdk/b/m;->bk:J

    cmp-long v4, v0, v2

    if-lez v4, :cond_0

    invoke-static {}, Lcom/baidu/crabsdk/b/m;->B()V

    invoke-static {p0}, Lcom/baidu/crabsdk/sender/i;->n(Landroid/content/Context;)V

    :cond_0
    return-void

    :cond_1
    const-string p0, "MobclickAgent init error!! applife upload failed!"

    invoke-static {p0}, Lcom/baidu/crabsdk/c/a;->v(Ljava/lang/String;)I

    :cond_2
    return-void
.end method
